package com.bclz.parallelism

import java.util.concurrent.{Executor, ExecutorService, Executors}
import Nonblocking._


object SysActorTest {

  def main(args: Array[String]): Unit = {
    val es=Executors.newFixedThreadPool(2)
//    val echoer=Actor[String](es){
    ////      msg=>{ println(s"Get message '$msg'!!")}
    ////    }
    ////    for(i <- (1 to 10000)){
    ////      new Thread(new Runnable {
    ////        override def run(): Unit = echoer ! "Hello"+i
    ////      }).start()
    ////    }
    ////    Thread.sleep(100)
    val unit = parMap(List.range(1,100))(a=>{null.toString;Math.sqrt(a)})
    println(run(es)(unit))
  }

}
